
/*
'===============================================================================
'  Generated From - CSharp_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.3)

using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Specialized;

using MyGeneration.dOOdads;

namespace DAL
{
	public abstract class _Event : SqlClientEntity
	{
		public _Event()
		{
			this.QuerySource = "Event";
			this.MappingName = "Event";

		}	

		//=================================================================
		//  public Overrides void AddNew()
		//=================================================================
		//
		//=================================================================
		public override void AddNew()
		{
			base.AddNew();
			
		}
		
		
		public override void FlushData()
		{
			this._whereClause = null;
			this._aggregateClause = null;
			base.FlushData();
		}
		
		//=================================================================
		//  	public Function LoadAll() As Boolean
		//=================================================================
		//  Loads all of the records in the database, and sets the currentRow to the first row
		//=================================================================
		public bool LoadAll() 
		{
			ListDictionary parameters = null;
			
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_EventLoadAll]", parameters);
		}
	
		//=================================================================
		// public Overridable Function LoadByPrimaryKey()  As Boolean
		//=================================================================
		//  Loads a single row of via the primary key
		//=================================================================
		public virtual bool LoadByPrimaryKey(int EventID)
		{
			ListDictionary parameters = new ListDictionary();
			parameters.Add(Parameters.EventID, EventID);

		
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_EventLoadByPrimaryKey]", parameters);
		}
		
		#region Parameters
		protected class Parameters
		{
			
			public static SqlParameter EventID
			{
				get
				{
					return new SqlParameter("@EventID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter EventTypeID
			{
				get
				{
					return new SqlParameter("@EventTypeID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter MemberID
			{
				get
				{
					return new SqlParameter("@MemberID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter EventName
			{
				get
				{
					return new SqlParameter("@EventName", SqlDbType.NVarChar, 500);
				}
			}
			
			public static SqlParameter EventPlace
			{
				get
				{
					return new SqlParameter("@EventPlace", SqlDbType.NVarChar, 500);
				}
			}
			
			public static SqlParameter EventDate
			{
				get
				{
					return new SqlParameter("@EventDate", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter EventTimeFrom
			{
				get
				{
					return new SqlParameter("@EventTimeFrom", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter EventTimeTo
			{
				get
				{
					return new SqlParameter("@EventTimeTo", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter EventTshirt
			{
				get
				{
					return new SqlParameter("@EventTshirt", SqlDbType.NVarChar, 500);
				}
			}
			
			public static SqlParameter MainImagePath
			{
				get
				{
					return new SqlParameter("@MainImagePath", SqlDbType.NVarChar, 500);
				}
			}
			
		}
		#endregion		
	
		#region ColumnNames
		public class ColumnNames
		{  
            public const string EventID = "EventID";
            public const string EventTypeID = "EventTypeID";
            public const string MemberID = "MemberID";
            public const string EventName = "EventName";
            public const string EventPlace = "EventPlace";
            public const string EventDate = "EventDate";
            public const string EventTimeFrom = "EventTimeFrom";
            public const string EventTimeTo = "EventTimeTo";
            public const string EventTshirt = "EventTshirt";
            public const string MainImagePath = "MainImagePath";

			static public string ToPropertyName(string columnName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[EventID] = _Event.PropertyNames.EventID;
					ht[EventTypeID] = _Event.PropertyNames.EventTypeID;
					ht[MemberID] = _Event.PropertyNames.MemberID;
					ht[EventName] = _Event.PropertyNames.EventName;
					ht[EventPlace] = _Event.PropertyNames.EventPlace;
					ht[EventDate] = _Event.PropertyNames.EventDate;
					ht[EventTimeFrom] = _Event.PropertyNames.EventTimeFrom;
					ht[EventTimeTo] = _Event.PropertyNames.EventTimeTo;
					ht[EventTshirt] = _Event.PropertyNames.EventTshirt;
					ht[MainImagePath] = _Event.PropertyNames.MainImagePath;

				}
				return (string)ht[columnName];
			}

			static private Hashtable ht = null;			 
		}
		#endregion
		
		#region PropertyNames
		public class PropertyNames
		{  
            public const string EventID = "EventID";
            public const string EventTypeID = "EventTypeID";
            public const string MemberID = "MemberID";
            public const string EventName = "EventName";
            public const string EventPlace = "EventPlace";
            public const string EventDate = "EventDate";
            public const string EventTimeFrom = "EventTimeFrom";
            public const string EventTimeTo = "EventTimeTo";
            public const string EventTshirt = "EventTshirt";
            public const string MainImagePath = "MainImagePath";

			static public string ToColumnName(string propertyName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[EventID] = _Event.ColumnNames.EventID;
					ht[EventTypeID] = _Event.ColumnNames.EventTypeID;
					ht[MemberID] = _Event.ColumnNames.MemberID;
					ht[EventName] = _Event.ColumnNames.EventName;
					ht[EventPlace] = _Event.ColumnNames.EventPlace;
					ht[EventDate] = _Event.ColumnNames.EventDate;
					ht[EventTimeFrom] = _Event.ColumnNames.EventTimeFrom;
					ht[EventTimeTo] = _Event.ColumnNames.EventTimeTo;
					ht[EventTshirt] = _Event.ColumnNames.EventTshirt;
					ht[MainImagePath] = _Event.ColumnNames.MainImagePath;

				}
				return (string)ht[propertyName];
			}

			static private Hashtable ht = null;			 
		}			 
		#endregion	

		#region StringPropertyNames
		public class StringPropertyNames
		{  
            public const string EventID = "s_EventID";
            public const string EventTypeID = "s_EventTypeID";
            public const string MemberID = "s_MemberID";
            public const string EventName = "s_EventName";
            public const string EventPlace = "s_EventPlace";
            public const string EventDate = "s_EventDate";
            public const string EventTimeFrom = "s_EventTimeFrom";
            public const string EventTimeTo = "s_EventTimeTo";
            public const string EventTshirt = "s_EventTshirt";
            public const string MainImagePath = "s_MainImagePath";

		}
		#endregion		
		
		#region Properties
	
		public virtual int EventID
	    {
			get
	        {
				return base.Getint(ColumnNames.EventID);
			}
			set
	        {
				base.Setint(ColumnNames.EventID, value);
			}
		}

		public virtual int EventTypeID
	    {
			get
	        {
				return base.Getint(ColumnNames.EventTypeID);
			}
			set
	        {
				base.Setint(ColumnNames.EventTypeID, value);
			}
		}

		public virtual int MemberID
	    {
			get
	        {
				return base.Getint(ColumnNames.MemberID);
			}
			set
	        {
				base.Setint(ColumnNames.MemberID, value);
			}
		}

		public virtual string EventName
	    {
			get
	        {
				return base.Getstring(ColumnNames.EventName);
			}
			set
	        {
				base.Setstring(ColumnNames.EventName, value);
			}
		}

		public virtual string EventPlace
	    {
			get
	        {
				return base.Getstring(ColumnNames.EventPlace);
			}
			set
	        {
				base.Setstring(ColumnNames.EventPlace, value);
			}
		}

		public virtual DateTime EventDate
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.EventDate);
			}
			set
	        {
				base.SetDateTime(ColumnNames.EventDate, value);
			}
		}

		public virtual DateTime EventTimeFrom
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.EventTimeFrom);
			}
			set
	        {
				base.SetDateTime(ColumnNames.EventTimeFrom, value);
			}
		}

		public virtual DateTime EventTimeTo
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.EventTimeTo);
			}
			set
	        {
				base.SetDateTime(ColumnNames.EventTimeTo, value);
			}
		}

		public virtual string EventTshirt
	    {
			get
	        {
				return base.Getstring(ColumnNames.EventTshirt);
			}
			set
	        {
				base.Setstring(ColumnNames.EventTshirt, value);
			}
		}

		public virtual string MainImagePath
	    {
			get
	        {
				return base.Getstring(ColumnNames.MainImagePath);
			}
			set
	        {
				base.Setstring(ColumnNames.MainImagePath, value);
			}
		}


		#endregion
		
		#region String Properties
	
		public virtual string s_EventID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EventID) ? string.Empty : base.GetintAsString(ColumnNames.EventID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EventID);
				else
					this.EventID = base.SetintAsString(ColumnNames.EventID, value);
			}
		}

		public virtual string s_EventTypeID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EventTypeID) ? string.Empty : base.GetintAsString(ColumnNames.EventTypeID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EventTypeID);
				else
					this.EventTypeID = base.SetintAsString(ColumnNames.EventTypeID, value);
			}
		}

		public virtual string s_MemberID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.MemberID) ? string.Empty : base.GetintAsString(ColumnNames.MemberID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.MemberID);
				else
					this.MemberID = base.SetintAsString(ColumnNames.MemberID, value);
			}
		}

		public virtual string s_EventName
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EventName) ? string.Empty : base.GetstringAsString(ColumnNames.EventName);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EventName);
				else
					this.EventName = base.SetstringAsString(ColumnNames.EventName, value);
			}
		}

		public virtual string s_EventPlace
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EventPlace) ? string.Empty : base.GetstringAsString(ColumnNames.EventPlace);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EventPlace);
				else
					this.EventPlace = base.SetstringAsString(ColumnNames.EventPlace, value);
			}
		}

		public virtual string s_EventDate
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EventDate) ? string.Empty : base.GetDateTimeAsString(ColumnNames.EventDate);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EventDate);
				else
					this.EventDate = base.SetDateTimeAsString(ColumnNames.EventDate, value);
			}
		}

		public virtual string s_EventTimeFrom
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EventTimeFrom) ? string.Empty : base.GetDateTimeAsString(ColumnNames.EventTimeFrom);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EventTimeFrom);
				else
					this.EventTimeFrom = base.SetDateTimeAsString(ColumnNames.EventTimeFrom, value);
			}
		}

		public virtual string s_EventTimeTo
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EventTimeTo) ? string.Empty : base.GetDateTimeAsString(ColumnNames.EventTimeTo);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EventTimeTo);
				else
					this.EventTimeTo = base.SetDateTimeAsString(ColumnNames.EventTimeTo, value);
			}
		}

		public virtual string s_EventTshirt
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EventTshirt) ? string.Empty : base.GetstringAsString(ColumnNames.EventTshirt);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EventTshirt);
				else
					this.EventTshirt = base.SetstringAsString(ColumnNames.EventTshirt, value);
			}
		}

		public virtual string s_MainImagePath
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.MainImagePath) ? string.Empty : base.GetstringAsString(ColumnNames.MainImagePath);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.MainImagePath);
				else
					this.MainImagePath = base.SetstringAsString(ColumnNames.MainImagePath, value);
			}
		}


		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region WhereParameter TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter EventID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EventID, Parameters.EventID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EventTypeID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EventTypeID, Parameters.EventTypeID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter MemberID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.MemberID, Parameters.MemberID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EventName
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EventName, Parameters.EventName);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EventPlace
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EventPlace, Parameters.EventPlace);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EventDate
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EventDate, Parameters.EventDate);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EventTimeFrom
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EventTimeFrom, Parameters.EventTimeFrom);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EventTimeTo
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EventTimeTo, Parameters.EventTimeTo);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EventTshirt
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EventTshirt, Parameters.EventTshirt);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter MainImagePath
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.MainImagePath, Parameters.MainImagePath);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter EventID
		    {
				get
		        {
					if(_EventID_W == null)
	        	    {
						_EventID_W = TearOff.EventID;
					}
					return _EventID_W;
				}
			}

			public WhereParameter EventTypeID
		    {
				get
		        {
					if(_EventTypeID_W == null)
	        	    {
						_EventTypeID_W = TearOff.EventTypeID;
					}
					return _EventTypeID_W;
				}
			}

			public WhereParameter MemberID
		    {
				get
		        {
					if(_MemberID_W == null)
	        	    {
						_MemberID_W = TearOff.MemberID;
					}
					return _MemberID_W;
				}
			}

			public WhereParameter EventName
		    {
				get
		        {
					if(_EventName_W == null)
	        	    {
						_EventName_W = TearOff.EventName;
					}
					return _EventName_W;
				}
			}

			public WhereParameter EventPlace
		    {
				get
		        {
					if(_EventPlace_W == null)
	        	    {
						_EventPlace_W = TearOff.EventPlace;
					}
					return _EventPlace_W;
				}
			}

			public WhereParameter EventDate
		    {
				get
		        {
					if(_EventDate_W == null)
	        	    {
						_EventDate_W = TearOff.EventDate;
					}
					return _EventDate_W;
				}
			}

			public WhereParameter EventTimeFrom
		    {
				get
		        {
					if(_EventTimeFrom_W == null)
	        	    {
						_EventTimeFrom_W = TearOff.EventTimeFrom;
					}
					return _EventTimeFrom_W;
				}
			}

			public WhereParameter EventTimeTo
		    {
				get
		        {
					if(_EventTimeTo_W == null)
	        	    {
						_EventTimeTo_W = TearOff.EventTimeTo;
					}
					return _EventTimeTo_W;
				}
			}

			public WhereParameter EventTshirt
		    {
				get
		        {
					if(_EventTshirt_W == null)
	        	    {
						_EventTshirt_W = TearOff.EventTshirt;
					}
					return _EventTshirt_W;
				}
			}

			public WhereParameter MainImagePath
		    {
				get
		        {
					if(_MainImagePath_W == null)
	        	    {
						_MainImagePath_W = TearOff.MainImagePath;
					}
					return _MainImagePath_W;
				}
			}

			private WhereParameter _EventID_W = null;
			private WhereParameter _EventTypeID_W = null;
			private WhereParameter _MemberID_W = null;
			private WhereParameter _EventName_W = null;
			private WhereParameter _EventPlace_W = null;
			private WhereParameter _EventDate_W = null;
			private WhereParameter _EventTimeFrom_W = null;
			private WhereParameter _EventTimeTo_W = null;
			private WhereParameter _EventTshirt_W = null;
			private WhereParameter _MainImagePath_W = null;

			public void WhereClauseReset()
			{
				_EventID_W = null;
				_EventTypeID_W = null;
				_MemberID_W = null;
				_EventName_W = null;
				_EventPlace_W = null;
				_EventDate_W = null;
				_EventTimeFrom_W = null;
				_EventTimeTo_W = null;
				_EventTshirt_W = null;
				_MainImagePath_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
	
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region AggregateParameter TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter EventID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EventID, Parameters.EventID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EventTypeID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EventTypeID, Parameters.EventTypeID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter MemberID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.MemberID, Parameters.MemberID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EventName
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EventName, Parameters.EventName);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EventPlace
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EventPlace, Parameters.EventPlace);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EventDate
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EventDate, Parameters.EventDate);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EventTimeFrom
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EventTimeFrom, Parameters.EventTimeFrom);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EventTimeTo
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EventTimeTo, Parameters.EventTimeTo);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EventTshirt
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EventTshirt, Parameters.EventTshirt);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter MainImagePath
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.MainImagePath, Parameters.MainImagePath);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter EventID
		    {
				get
		        {
					if(_EventID_W == null)
	        	    {
						_EventID_W = TearOff.EventID;
					}
					return _EventID_W;
				}
			}

			public AggregateParameter EventTypeID
		    {
				get
		        {
					if(_EventTypeID_W == null)
	        	    {
						_EventTypeID_W = TearOff.EventTypeID;
					}
					return _EventTypeID_W;
				}
			}

			public AggregateParameter MemberID
		    {
				get
		        {
					if(_MemberID_W == null)
	        	    {
						_MemberID_W = TearOff.MemberID;
					}
					return _MemberID_W;
				}
			}

			public AggregateParameter EventName
		    {
				get
		        {
					if(_EventName_W == null)
	        	    {
						_EventName_W = TearOff.EventName;
					}
					return _EventName_W;
				}
			}

			public AggregateParameter EventPlace
		    {
				get
		        {
					if(_EventPlace_W == null)
	        	    {
						_EventPlace_W = TearOff.EventPlace;
					}
					return _EventPlace_W;
				}
			}

			public AggregateParameter EventDate
		    {
				get
		        {
					if(_EventDate_W == null)
	        	    {
						_EventDate_W = TearOff.EventDate;
					}
					return _EventDate_W;
				}
			}

			public AggregateParameter EventTimeFrom
		    {
				get
		        {
					if(_EventTimeFrom_W == null)
	        	    {
						_EventTimeFrom_W = TearOff.EventTimeFrom;
					}
					return _EventTimeFrom_W;
				}
			}

			public AggregateParameter EventTimeTo
		    {
				get
		        {
					if(_EventTimeTo_W == null)
	        	    {
						_EventTimeTo_W = TearOff.EventTimeTo;
					}
					return _EventTimeTo_W;
				}
			}

			public AggregateParameter EventTshirt
		    {
				get
		        {
					if(_EventTshirt_W == null)
	        	    {
						_EventTshirt_W = TearOff.EventTshirt;
					}
					return _EventTshirt_W;
				}
			}

			public AggregateParameter MainImagePath
		    {
				get
		        {
					if(_MainImagePath_W == null)
	        	    {
						_MainImagePath_W = TearOff.MainImagePath;
					}
					return _MainImagePath_W;
				}
			}

			private AggregateParameter _EventID_W = null;
			private AggregateParameter _EventTypeID_W = null;
			private AggregateParameter _MemberID_W = null;
			private AggregateParameter _EventName_W = null;
			private AggregateParameter _EventPlace_W = null;
			private AggregateParameter _EventDate_W = null;
			private AggregateParameter _EventTimeFrom_W = null;
			private AggregateParameter _EventTimeTo_W = null;
			private AggregateParameter _EventTshirt_W = null;
			private AggregateParameter _MainImagePath_W = null;

			public void AggregateClauseReset()
			{
				_EventID_W = null;
				_EventTypeID_W = null;
				_MemberID_W = null;
				_EventName_W = null;
				_EventPlace_W = null;
				_EventDate_W = null;
				_EventTimeFrom_W = null;
				_EventTimeTo_W = null;
				_EventTshirt_W = null;
				_MainImagePath_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	
		protected override IDbCommand GetInsertCommand() 
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_EventInsert]";
	
			CreateParameters(cmd);
			
			SqlParameter p;
			p = cmd.Parameters[Parameters.EventID.ParameterName];
			p.Direction = ParameterDirection.Output;
    
			return cmd;
		}
	
		protected override IDbCommand GetUpdateCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_EventUpdate]";
	
			CreateParameters(cmd);
			      
			return cmd;
		}
	
		protected override IDbCommand GetDeleteCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_EventDelete]";
	
			SqlParameter p;
			p = cmd.Parameters.Add(Parameters.EventID);
			p.SourceColumn = ColumnNames.EventID;
			p.SourceVersion = DataRowVersion.Current;

  
			return cmd;
		}
		
		private IDbCommand CreateParameters(SqlCommand cmd)
		{
			SqlParameter p;
		
			p = cmd.Parameters.Add(Parameters.EventID);
			p.SourceColumn = ColumnNames.EventID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EventTypeID);
			p.SourceColumn = ColumnNames.EventTypeID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.MemberID);
			p.SourceColumn = ColumnNames.MemberID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EventName);
			p.SourceColumn = ColumnNames.EventName;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EventPlace);
			p.SourceColumn = ColumnNames.EventPlace;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EventDate);
			p.SourceColumn = ColumnNames.EventDate;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EventTimeFrom);
			p.SourceColumn = ColumnNames.EventTimeFrom;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EventTimeTo);
			p.SourceColumn = ColumnNames.EventTimeTo;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EventTshirt);
			p.SourceColumn = ColumnNames.EventTshirt;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.MainImagePath);
			p.SourceColumn = ColumnNames.MainImagePath;
			p.SourceVersion = DataRowVersion.Current;


			return cmd;
		}
	}
}
